#ifndef CAMERACOMPONENT_H_
#define CAMERACOMPONENT_H_


#include "LibraryFrameworkExport.h"
#include "Game/GameTime.h"
#include "Entities/Component.h"
#include "Entities/BaseEntity.h"
#include "Maths/Matrix4.h"

#include <iosfwd>
#include <string>

namespace CasaEngine
{
	class ICameraController;

	/*
	 *	
	 */
	class LIBRARY_FRAMEWORK_EXPORT CameraComponent :
		public Component
	{
	public:
		Matrix4 GetViewMatrix() const;
		Matrix4 GetProjectionMatrix() const;	
	
		void Update(const GameTime& gameTime_);

		ICameraController * CameraController() const;
		void CameraController(ICameraController * val);

		//entities should be able to read/write their data to a stream
		void Write(std::ostream&  os)const;
		void Read (std::ifstream& is);

	protected:
		CameraComponent(BaseEntity* pEntity_, int type_);
		virtual ~CameraComponent();

	protected:
		Matrix4 m_ViewMatrix;
		Matrix4 m_ProjectionMatrix;

	private:
		ICameraController *m_pCameraController;
	};

}

#endif // CAMERACOMPONENT_H_


